public class Test3 {
    public static void main(String[] args) throws InterruptedException {
        Thread t1 = new Thread(() -> {
            int count = 1;
            while(count > 0){
                System.out.println("线程1正在执行");
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
                count--;
            }
        });
        t1.start();

        t1.join();
        int count = 10;
        while(count > 0){
            System.out.println("main线程正在执行");
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            count--;
        }

    }
}
